package cn.edu.ctbu.api01.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;

@Aspect
@Component
@Slf4j
public class HttpAspect {
    @Pointcut("execution(public * cn.edu.ctbu.api01.restcontroller.StudentRestController.*(..))")
    public void log(){
    }
    @Before("log()")
    public void doBefore(){
        System.out.println("1111");
    }
    @After("log()")
    public void doAfter(){
        System.out.println("222");
    }
    @AfterReturning(returning = "object",pointcut = "log()")
    public void doAfterReturning(Object object){
        log.info("response={}",object);
    }
}
